<template>
  <div ref="line"></div>
</template>

<script>
//引包
import * as echarts from "echarts";
export default {
  name: "",
  //因为可以获取容器
  mounted() {
    //初始化echarts实例
    let mycharts = echarts.init(this.$refs.line);
    //设置配置项
    let options = {
   
      //调整图表的布局
      grid: {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0,
      },
      xAxis: {
        show: false,
        //x轴均分
        type: "category",
        //两侧不留白
      },
      yAxis: { show: false },
      series: {
        type: "bar",
        data: [22, 44, 19, 13, 66, 32, 57],  
        color:'yellowgreen'
      },
      tooltip:{}
    };
    //设置配置项
    mycharts.setOption(options);
  },
};
</script>

<style scoped>
div {
  width: 100%;
  height: 100%;
}
</style>
